/*
 * Title: WADS
 * Description: Web-based Auto flow Documents System
 * Copyright: 2007
 * Company: CoE
 * @author: Mr.Nattasan Wang-Aphisit
 * @version 1.1
 */

package wads.app;

import java.awt.Cursor;
import java.awt.Rectangle;

public class SelectionHandle {
  private Rectangle rect;
  private Cursor cursor;

  public SelectionHandle (Rectangle r, Cursor c) {
        this.rect = r;
        this.cursor = c;
    }

  public SelectionHandle (int x, int y, int width, int height, Cursor cursor) {
    this.rect = new Rectangle(x, y, width, height);
    this.cursor = cursor;
  }

  public int getCaseCursorType() {
    if (getCursor() instanceof CaseCursor)
      return ((CaseCursor)getCursor()).getCaseType();
    else
      return -1;
  }

  public void setCaseCursorType(int type) {
    if (getCursor() instanceof CaseCursor)
      ((CaseCursor)getCursor()).setCaseType(type);
  }

    /**
     * @return the rect
     */
    public Rectangle getRect() {
        return rect;
    }

    /**
     * @param rect the rect to set
     */
    public void setRect(Rectangle rect) {
        this.rect = rect;
    }

    /**
     * @return the cursor
     */
    public Cursor getCursor() {
        return cursor;
    }

    /**
     * @param cursor the cursor to set
     */
    public void setCursor(Cursor cursor) {
        this.cursor = cursor;
    }
}
